import request from '@/utils/request'

export const login = (data) => request.post('/user/login', data)

export const register = (data) => request.post('/user/register', data)

export const getCode = (phone) =>
  request.post('/user/code', phone, {
    headers: {
      'Content-Type': 'application/json' // 设置请求体的 Content-Type
    }
  })
//获取用户基本信息
export const baseinfor = () => request.get(`user/me`)
//更新用户状态
export const updateinfo = (obj) => request.post('/user/info', obj)
//根据id获取用户所有信息
export const getbyid = (id) => request.get(`/user/info/${id}`)
//退出登录
export const logout = () => request.post('/user/logout')
